// 公共路由
import LayOut from "@/layOut"

// 静态路由配置
// 所有非菜单在页面中点击按钮跳转的路由，都按照这种格式去配置
const staticRoutes = [
    {
        path: "/systemManage",
        component: LayOut,
        hidden: true,
        active: false,
        meta: { title: "", icon: "", fatherPath: "/system" },
        children: [
            {
                path: "menuManage",
                name: "menuManage",
                meta: { title: "菜单管理", icon: "", fatherPath: "/system", noCached: false },
                component: () => import("@/views/systemManage/menuManage"),
            }, {
                path: "userManage",
                name: "UserManage",
                meta: { title: "用户管理", icon: "", fatherPath: "/system", noCached: false },
                component: () => import("@/views/systemManage/userManage"),
            }, {
                path: "roleManage",
                name: "RoleManage",
                meta: { title: "角色管理", icon: "", fatherPath: "/system", noCached: false },
                component: () => import("@/views/systemManage/roleManage"),
            },
        ]
    }, {
        path: "/goodsManage",
        component: LayOut,
        hidden: true,
        active: false,
        meta: { title: "", icon: "", fatherPath: "/archives" },
        children: [
            {
                path: "goodsType",
                name: "GoodsType",
                meta: { title: "商品类别", icon: "", fatherPath: "/archives", noCached: false },
                component: () => import("@/views/goodsManage/goodsType"),
            }, {
                path: "goodsBrand",
                name: "GoodsBrand",
                meta: { title: "商品品牌", icon: "", fatherPath: "/archives", noCached: false },
                component: () => import("@/views/goodsManage/goodsBrand"),
            }
        ]
    },
]

// 公共路由
const constantRoutes = [
    {
        path: "",
        component: LayOut,
        active: true,
        meta: { title: "首页", icon: "icon-board", fatherPath: '/' },
        children: [
            {
                path: "/",
                name: "Preview",
                meta: { title: "首页", icon: "icon-board", fatherPath: '/', noCache: true },
                component: () => import("@/views/preview.vue")
            }
        ]
    }, {
        path: "",
        component: LayOut,
        active: false,
        meta: { title: "桌面", icon: "icon-board", fatherPath: '/desktop' },
        children: [
            {
                path: "/desktop",
                name: "Desktop",
                meta: { title: "桌面", icon: "icon-board", fatherPath: '/desktop', noCache: true },
                component: () => import("@/views/desktop.vue")
            }
        ]
    }, {
        path: '/login',
        name: 'Login',
        hidden: true,
        active: false,
        meta: { title: "登录" },
        component: () => import("@/views/login.vue")
    }, {
        path: "*",
        name: "NotFound",
        hidden: true,
        active: false,
        meta: { title: "404 NotFound" },
        component: () => import("@/views/notFound.vue")
    }
]

export default constantRoutes.concat(staticRoutes)
